package com.five.api;

import com.five.dto.IdRequest;
import com.five.pojo.Novel;
import com.five.result.Result;
import com.five.vo.NovelRankVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;

@FeignClient(name = "user-service", path = "/user/novel",contextId = "novelServiceAPI")
public interface NovelServiceApi {

    /*
     * 创建小说
     */
    @PostMapping("/add")
    public Result add(@RequestBody Novel novel);


    /*
     * 更新小说
     */
    @PostMapping("/update")
    public Result update(@RequestBody Novel novel) ;

    /*
     * 删除小说
     */
    @PostMapping("/delete/{id}")
    public Result delete(@PathVariable Long id) ;

    /*
     * 批量删除小说
     */
    @PostMapping("/deleteBatch")
    public Result deleteBatch(@RequestBody List<Long> ids);

    /*
     * 分页查询小说
     */
    @PostMapping("/queryPage")
    public Result queryPage(@RequestBody Novel novel);


    /*
     * 查询小说数量
     */
    @PostMapping("/queryCount")
    public Result queryCount(@RequestBody Novel novel) ;

    /*
     * 查询所有小说
     */
    @PostMapping("/queryAll")
    public Result queryAll() ;

    /**
    * 查询小说排行榜
    */
    @PostMapping("/rank/collect/top10")
    public Result<List<NovelRankVo>> top10Collect();


}
